package com.heima.apis.user;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-user")
public interface IUserClient {

    /**
     * 通过
     * @param id
     * @return
     */
    @GetMapping("/api/v1/comment/findById/{id}")
    public ResponseResult findUser(@PathVariable("id") Integer id);

    /**
     * 根据名字查用户
     * @param name
     * @return
     */
    @PostMapping("/api/v1/comment/findUserById")
    ApUser findUserByName(@RequestBody String name);

    /**
     * 根据名字查用户
     * @param userId
     * @return
     */
    @PostMapping("/api/v1/comment/findUserByName")
    ApUser findUserById(@RequestBody Integer userId);
}
